<html>
<head>
<script type="text/javascript" src = "../FusionCharts/FusionCharts.js"></script>
	<script type="text/javascript" src = "../FusionCharts/FusionChartsExportComponent.js"></script>
</head>

<body bgcolor="#ffffff">
<div id="chartdiv2" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div>
<script type="text/javascript">
var myChart = new FusionCharts("../FusionCharts/FCF_Funnel.swf", "myChartId2", "540", "440", "0", "1");
myChart.setDataURL("2.xml");
myChart.render("chartdiv2");
</script>

<!-- We also create a DIV to contain the FusionCharts client-side exporter component -->
<div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div>
<script type="text/javascript">
var myExportComponent = new FusionChartsExportObject("fcExporter1", "flashChart/FCExporter.swf");

myExportComponent.Render("fcexpDiv");

function FC_Exported(objRtn)
	{     
       if(objRtn.statusCode=="1")
       {   
          alert("The chart with DOM Id " + objRtn.DOMId + " was successfully saved on server. The file can be accessed from" + objRtn.fileName);   
	   }
	   else
	   {   
	       alert("The chart with DOM Id " + objRtn.DOMId + " could not be saved on server. There was an error. Description : " + objRtn.statusMessage);   
	   }   
	}   
	//导出图片调用的方法   
	function startExport()
	{  
	var chart = getChartFromId("myChartId");   //生成的FusionCharts图表本身的标识
	     if (chart.hasRendered())
	     {   
             chart.exportChart();   
	     }
	     else
	     {   
	         alert("Please wait for the chart to finish rendering, before you can invoke exporting");   
	     }
	var chart = getChartFromId("myChartId2");   //生成的FusionCharts图表本身的标识
	     if (chart.hasRendered())
	     {   
             chart.exportChart();   
	     }
	     else
	     {   
	         alert("Please wait for the chart to finish rendering, before you can invoke exporting");   
	     }
	//document.getElementById("chartdiv").innerHTML = "<img src='savefiles/test3.jpg'>";
	     
	}
</script>
<input type='button' value='导出FusionCharts图片' onClick="javascript:startExport();"/>
</body>
</html>
